Namespacing everything to /UVa.
[andmenj-acm.git] / UVa / 11364 - Optimal parking / 11364.c
blob495880622e9e91de1a1593b3e94a92aba34e299b
1 #include <stdio.h>
2 #include <stdlib.h>
3 int less(const void*a, const void*b){return*(short*)(a)-*(short*)(b);}
4 int main(){
5 short i, c, a[20], n;
6 for (scanf("%hd", &c); c--; printf("%hd\n", 2*(a[n-1]-a[0]))){
7 for (scanf("%hd", &n), i=0; i<n; scanf("%hd", &a[i++]));
8 qsort(a, n, sizeof(short), less);
10 return 0;